<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue中的条件渲染</title>
    <script src="../../vue.js"></script>
</head>

<body>
    <div id="app">
        <div v-if="show">{{msg}}</div> <!-- 1. v-if指令是判断指令,如果判断条件不成立,则整个dom都不会存在 -->
        <div v-show="show">{{msg}}</div>  <!-- 2. v-show指令是隐藏展示指令,如果判断条件不成立,则整个dom只是设置为:style="display: none;"，并没有真的消失 -->
    </div>

    <script>
        const app = new Vue({
            el: '#app',
            data: {
                msg: 'hello world',
                show: false
            }
        })
    </script>
</body>

</html>